package com.example.springboot.system.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 图书册表
 * </p>
 *
 * @author he
 * @since 2024-05-28
 */
@Getter
@Setter
@TableName("zhiyue_bookno")
@Schema(name = "BooknoEntity", description = "$!{table.comment}")
public class BooknoEntity extends Model<BooknoEntity> {

    @ExcelProperty("编号")
    @Schema(description = "编号")
    @TableId(value = "bookno_id", type = IdType.AUTO)
    private Integer id;

    @ColumnWidth(value = 20)
    @ExcelProperty("书本条码")
    @Schema(description = "书本条码")
    @TableField("bookno_code")
    private String code;

    @ColumnWidth(value = 20)
    @ExcelProperty("书册编号")
    @Schema(description = "书册编号")
    @TableField("bookno_books_id")
    private Integer booksId;

    @ColumnWidth(value = 20)
    @ExcelProperty("书本名称")
    @Schema(description = "书本名称")
    @TableField("bookno_name")
    private String name;

    @ColumnWidth(value = 20)
    @ExcelProperty("借阅用户")
    @Schema(description = "借阅用户")
    @TableField(value = "bookno_user_id",fill = FieldFill.UPDATE)
    private String userId;

    @ColumnWidth(value = 20)
    @ExcelProperty("借阅时间")
    @Schema(description = "借阅时间")
    @TableField("bookno_borrow_date")
    private String borrowDate;

    @ColumnWidth(value = 20)
    @ExcelProperty("借阅状态（0-借出 1-库存）")
    @Schema(description = "借阅状态（0-借出 1-库存）")
    @TableField("bookno_borrow")
    private Integer borrow;

    @ColumnWidth(value = 20)
    @ExcelProperty("创建者")
    @Schema(description = "创建者")
    @TableField("create_by")
    private String createBy;

    @ColumnWidth(value = 20)
    @ExcelProperty("创建时间")
    @Schema(description = "创建时间")
    @TableField("create_time")
    private String createTime;

    @ColumnWidth(value = 20)
    @ExcelProperty("更新者")
    @Schema(description = "更新者")
    @TableField("update_by")
    private String updateBy;

    @ColumnWidth(value = 20)
    @ExcelProperty("更新时间")
    @Schema(description = "更新时间")
    @TableField("update_time")
    private String updateTime;

    @ColumnWidth(value = 20)
    @ExcelProperty("伪删除（0-已 1-未）")
    @Schema(description = "伪删除（0-已 1-未）")
    @TableField("undock")
    private Integer undock;

    @ColumnWidth(value = 20)
    @ExcelProperty("状态（0-禁用 1-正常）")
    @Schema(description = "状态（0-禁用 1-正常）")
    @TableField("unlucky")
    private Integer unlucky;

    @ColumnWidth(value = 40)
    @ExcelProperty("备注")
    @Schema(description = "备注")
    @TableField("remark")
    private String remark;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
